﻿using System;
namespace Study01
{
    public class Player
    {
        private string name;
        private int age;
        
        //setter/getter java写法
        public void setName(string name)
        {
            this.name = name;
        }

        public string getName()
        {
            return name;
        }
        
        public void setAge(int age)
        {
            this.age = age;
        }

        public int getAge()
        {
            return age;
        }
        
        
/*

        public string Name
        {
            get => name;
            set => name = value;
        }

        

        public int Age
        {
            get => age;
            set => age = value;
        }*/

        public Player()
        {
        }

        public Player(string name, int age)
        {
            this.name = name;
            this.age = age;
        }

        public override string ToString()
        {
            return "###"+name+":"+age;
        }
    }
}
